{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "4da61aba-b4fc-4f30-8b11-623900d8d914",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Note: you may need to restart the kernel to use updated packages.\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\u001b[2mResolved \u001b[1m104 packages\u001b[0m \u001b[2min 0.69ms\u001b[0m\u001b[0m\n",
      "\u001b[2mAudited \u001b[1m100 packages\u001b[0m \u001b[2min 0.02ms\u001b[0m\u001b[0m\n"
     ]
    }
   ],
   "source": [
    "uv add openai"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "9da95493-a3ee-41cd-b5b4-8b47a17a5186",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "from dotenv import load_dotenv\n",
    "#load_dotenv(override=True)\n",
    "from openai import OpenAI"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "e5eec26d-b134-4c91-b916-e4c220c8dc1d",
   "metadata": {},
   "outputs": [],
   "source": [
    "client = OpenAI(\n",
    "  base_url=\"https://ai.devtool.tech/proxy/v1\",\n",
    "  api_key=\"openai-key\",\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "0487d010-3cbf-416a-977a-da5dd69e2c6a",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 查看模型列表\n",
    "model_list = client.models.list()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "0af045e3-c7c3-48d6-9edb-8794614e3f11",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[Model(id='gpt-3.5-turbo', created=1677610602, object='model', owned_by='openai'),\n",
       " Model(id='gpt-5-nano', created=1754426384, object='model', owned_by='system'),\n",
       " Model(id='gpt-5', created=1754425777, object='model', owned_by='system'),\n",
       " Model(id='gpt-5-mini-2025-08-07', created=1754425867, object='model', owned_by='system'),\n",
       " Model(id='gpt-5-mini', created=1754425928, object='model', owned_by='system'),\n",
       " Model(id='gpt-5-nano-2025-08-07', created=1754426303, object='model', owned_by='system'),\n",
       " Model(id='davinci-002', created=1692634301, object='model', owned_by='system'),\n",
       " Model(id='babbage-002', created=1692634615, object='model', owned_by='system'),\n",
       " Model(id='gpt-3.5-turbo-instruct', created=1692901427, object='model', owned_by='system'),\n",
       " Model(id='gpt-3.5-turbo-instruct-0914', created=1694122472, object='model', owned_by='system'),\n",
       " Model(id='dall-e-3', created=1698785189, object='model', owned_by='system'),\n",
       " Model(id='dall-e-2', created=1698798177, object='model', owned_by='system'),\n",
       " Model(id='gpt-3.5-turbo-1106', created=1698959748, object='model', owned_by='system'),\n",
       " Model(id='tts-1-hd', created=1699046015, object='model', owned_by='system'),\n",
       " Model(id='tts-1-1106', created=1699053241, object='model', owned_by='system'),\n",
       " Model(id='tts-1-hd-1106', created=1699053533, object='model', owned_by='system'),\n",
       " Model(id='text-embedding-3-small', created=1705948997, object='model', owned_by='system'),\n",
       " Model(id='text-embedding-3-large', created=1705953180, object='model', owned_by='system'),\n",
       " Model(id='gpt-3.5-turbo-0125', created=1706048358, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o', created=1715367049, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-2024-05-13', created=1715368132, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-mini-2024-07-18', created=1721172717, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-mini', created=1721172741, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-2024-08-06', created=1722814719, object='model', owned_by='system'),\n",
       " Model(id='o1-mini-2024-09-12', created=1725648979, object='model', owned_by='system'),\n",
       " Model(id='o1-mini', created=1725649008, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-audio-preview-2024-10-01', created=1727389042, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-audio-preview', created=1727460443, object='model', owned_by='system'),\n",
       " Model(id='omni-moderation-latest', created=1731689265, object='model', owned_by='system'),\n",
       " Model(id='omni-moderation-2024-09-26', created=1732734466, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-audio-preview-2024-12-17', created=1734034239, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-mini-audio-preview-2024-12-17', created=1734115920, object='model', owned_by='system'),\n",
       " Model(id='o1-2024-12-17', created=1734326976, object='model', owned_by='system'),\n",
       " Model(id='o1', created=1734375816, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-mini-audio-preview', created=1734387424, object='model', owned_by='system'),\n",
       " Model(id='o3-mini', created=1737146383, object='model', owned_by='system'),\n",
       " Model(id='o3-mini-2025-01-31', created=1738010200, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-2024-11-20', created=1739331543, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-search-preview-2025-03-11', created=1741388170, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-search-preview', created=1741388720, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-mini-search-preview-2025-03-11', created=1741390858, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-mini-search-preview', created=1741391161, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-transcribe', created=1742068463, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-mini-transcribe', created=1742068596, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-mini-tts', created=1742403959, object='model', owned_by='system'),\n",
       " Model(id='o3-2025-04-16', created=1744133301, object='model', owned_by='system'),\n",
       " Model(id='o4-mini-2025-04-16', created=1744133506, object='model', owned_by='system'),\n",
       " Model(id='o3', created=1744225308, object='model', owned_by='system'),\n",
       " Model(id='o4-mini', created=1744225351, object='model', owned_by='system'),\n",
       " Model(id='gpt-4.1-2025-04-14', created=1744315746, object='model', owned_by='system'),\n",
       " Model(id='gpt-4.1', created=1744316542, object='model', owned_by='system'),\n",
       " Model(id='gpt-4.1-mini-2025-04-14', created=1744317547, object='model', owned_by='system'),\n",
       " Model(id='gpt-4.1-mini', created=1744318173, object='model', owned_by='system'),\n",
       " Model(id='gpt-4.1-nano-2025-04-14', created=1744321025, object='model', owned_by='system'),\n",
       " Model(id='gpt-4.1-nano', created=1744321707, object='model', owned_by='system'),\n",
       " Model(id='gpt-image-1', created=1745517030, object='model', owned_by='system'),\n",
       " Model(id='gpt-4o-audio-preview-2025-06-03', created=1748908498, object='model', owned_by='system'),\n",
       " Model(id='gpt-5-chat-latest', created=1754073306, object='model', owned_by='system'),\n",
       " Model(id='gpt-5-2025-08-07', created=1754075360, object='model', owned_by='system'),\n",
       " Model(id='whisper-1', created=1677532384, object='model', owned_by='openai-internal'),\n",
       " Model(id='tts-1', created=1681940951, object='model', owned_by='openai-internal'),\n",
       " Model(id='gpt-3.5-turbo-16k', created=1683758102, object='model', owned_by='openai-internal'),\n",
       " Model(id='text-embedding-ada-002', created=1671217299, object='model', owned_by='openai-internal')]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model_list.data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f9a12622-9a92-4339-8a20-4d1a9d11c122",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.0rc2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
